Array.prototype.bubbleSort = function () {
    for (let i = 0; i < this.length - 1; i += 1) {
        //通过 this.length 次把第一位放到最后,完成排序
        //-i是因为最后的位置是会动态改变的，当完成一次后,最后一位会变成倒数第二位
        for (let j = 0; j < this.length - 1 - i; j += 1) {
            if (this[j] > this[j + 1]) {
                const temp = this[j];
                this[j] = this[j + 1];
                this[j + 1] = temp;
            }
        }
    }
    console.log("距离冒泡排序完成");
};

var list = [3, 1, 2]
list.bubbleSort()
console.log(list);
var s = list.shift()
console.log(s, list);

var newlist = list.concat([4, 5])
console.log(newlist, list);